package com.hs.app.breakcall.adapter;

import java.util.List;
import java.util.Map;

import com.hs.app.breakcall.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class IntroAdapter extends ArrayAdapter<Map<String, Object>> {
	
	private List<Map<String, Object>> items;
	private Context context;
	private int resource;
	
	public IntroAdapter(Context context, int textViewResourceId,
			List<Map<String, Object>> items) {
		super(context, textViewResourceId, items);
		// TODO Auto-generated constructor stub
		this.context = context;
		this.resource = textViewResourceId;
		this.items = items;
	}
	
	public View getView(int position, View convertView, ViewGroup parent) {
		if(convertView == null) {
			LayoutInflater li = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
			convertView = li.inflate(resource, parent, false);
		}
		Map<String, Object> data = items.get(position);
		
		if(data != null){
			TextView textViewNumber = (TextView) convertView.findViewById(R.id.breakCallNumber);
//			textViewNumber.setText(data.get("breakCallNumber").toString());
			
			TextView textViewStart = (TextView) convertView.findViewById(R.id.breakCallStart);
//			textViewStart.setText(data.get("breakCallStart").toString());
			
			TextView textViewEnd = (TextView) convertView.findViewById(R.id.breakCallEnd);
//			textViewEnd.setText(data.get("breakCallEnd").toString());
			
		}
		return convertView;
	}
}
